﻿@using WebEntities
@using WebsiteUI.Extensions;

@{
    ViewBag.Title = "广州市华侨糖厂网站";
    Layout = "~/Views/Shared/_DefLayout.cshtml";
}

<div>
    <img src="/Images/index01.jpg" alt="" />
    <div class="function1">
        <div class="func_content">
            @{
                WI_News topnews = (ViewBag.NewsList1 as List<WI_News>).First();
                string descr = Server.HtmlDecode(topnews.Description);
                string pdescr = HtmlWorkshop.StripHtml(descr ?? string.Empty);
            }
            <div class="adimg1"><a href="/newsinfo/details/@topnews.NewsID" target="_blank"><img src="@topnews.NewsCover" alt="" /></a></div>
            <h3><a href="/newsinfo/details/@topnews.NewsID" target="_blank">@topnews.NewsTitle</a></h3>
            <div class="admore1"><a href="/newsinfo/details/@topnews.NewsID" target="_blank"><img src="/Images/more2.jpg" alt="更多" /></a></div>
            @*<dl>
                <dt><a href="/newsinfo/details/@topnews.NewsID" target="_blank"><img src="@topnews.NewsCover" alt="" /></a></dt>
                <dd>
                    <h3><a href="/newsinfo/details/@topnews.NewsID" target="_blank">@topnews.NewsTitle</a></h3>
                    <div>@Html.Raw(HtmlWorkshop.CutTitle(pdescr ?? string.Empty, 46))</div>
                    <div style="margin-top:10px"><a href="/newsinfo/details/@topnews.NewsID" target="_blank"><img src="/Images/more2.jpg" alt="更多" /></a></div>
                </dd>
            </dl>*@
            
        </div>
    </div>
</div>
<div style="position:relative">
    <div id="qrcodebar">
        <img src="/images/qrcode.jpg" alt="二维码" />
    </div>
</div>
<div class="index_panel">
    <table class="index_tab1">
        <tr>
            <td style="width:270px">
                <div class="info_panel">
                    <div class="info_tab">
                        <a href="#" class="actab" id="tab1">企业新闻</a>
                        <a href="#" id="tab2">行业动态</a>
                        <p><a href="/newsinfo" id="newsmore" target="_blank"><img src="/Images/more1.jpg" alt="更多" /></a></p>
                        <div class="cls"></div>
                    </div>
                    <ul class="info_list">
                        @{
                            List<WI_News> newsList1 = ViewBag.NewsList1 as List<WI_News>;
                            newsList1 = newsList1.Skip(1).Take(5).ToList();
                            foreach (var news1 in newsList1)
                            {
                                string title = string.IsNullOrWhiteSpace(news1.NewsTitle) ? string.Empty : HtmlWorkshop.CutTitle(news1.NewsTitle, 12);
                                DateTime dtime = (news1.PubTime.HasValue ? news1.PubTime : news1.CreateTime).Value;
                                <li><a href="/newsinfo/details/@news1.NewsID" title="@news1.NewsTitle" target="_blank">ㆍ@(title)</a><span>@(dtime.ToString("yyyy-MM-dd"))</span></li>
                            }
                        }
                        <li class="cls"></li>
                    </ul>
                    <ul class="info_list hid_infolst">
                        @{
                            List<WI_News> newsList2 = ViewBag.NewsList2 as List<WI_News>;
                            foreach (var news2 in newsList2)
                            {
                                string title = string.IsNullOrWhiteSpace(news2.NewsTitle) ? string.Empty : HtmlWorkshop.CutTitle(news2.NewsTitle, 12);
                                DateTime dtime = (news2.PubTime.HasValue ? news2.PubTime : news2.CreateTime).Value;
                                <li><a href="/newsinfo/details/@news2.NewsID" title="@news2.NewsTitle" target="_blank">ㆍ@(title)</a><span>@(dtime.ToString("yyyy-MM-dd"))</span></li>
                            }
                        }
                        <li class="cls"></li>
                    </ul>
                </div>
                <div class="search_panel">
                    @using (Html.BeginForm("search", "home", FormMethod.Post, new { name = "form1", id = "form1" }))
                    {
                        <p>&nbsp;</p>
                        <p>
                            <select name="seatype">
                                <option value="news">新闻资讯</option>
                                <option value="prods">产品展厅</option>
                            </select>
                        </p>
                        <p>@Html.TextBox("seakey", null, new { @class = "seachtext" })</p>
                        <p><img src="/Images/searchbtn.jpg" alt="" id="searchbtn" /></p>
                    }
                </div>
            </td>
            <td style="width:500px">
                <div class="newprod_panel">
                    <div class="newprod_bar">
                        <span class="lpan">产品中心</span>
                        <span class="rpan">
                            <a href="#"><img src="/Images/num1a.jpg" alt="" /></a>
                            <a href="#"><img src="/Images/num2.jpg" alt="" /></a>
                            <a href="#"><img src="/Images/num3.jpg" alt="" /></a>
                        </span>
                    </div>
                    <div class="cls"></div>
                    <div class="newprod_info">
                        <ul>
                        @{
                            List<PP_RecommendProduct> rprodList = ViewBag.RecomProductList as List<PP_RecommendProduct>;
                            foreach (var rprod in rprodList)
                            {
                                <li class="idxprodimg">
                                    <div><a href="/products/details/@rprod.ProductID" target="_blank"><img src="@rprod.IndexCover" alt="" /></a></div>
                                    <h3><a href="/products/details/@rprod.ProductID" target="_blank">@rprod.PP_Product.ProductName</a></h3>
                                </li>
                                @*string htmlDescr = Server.HtmlDecode(rprod.PP_Product != null ? rprod.PP_Product.Description : string.Empty);
                                string plainDescr = HtmlWorkshop.StripHtml(htmlDescr ?? string.Empty);
                                <dl>
                                    <dt><a href="/products/details/@rprod.ProductID" target="_blank"><img src="@rprod.IndexCover" alt="" /></a></dt>
                                    <dd>
                                        <h3><a href="/products/details/@rprod.ProductID" target="_blank">@(rprod.PP_Product != null ? rprod.PP_Product.ProductName : string.Empty)</a></h3>
                                        <div><a href="/products/details/@rprod.ProductID" target="_blank">@Html.Raw(HtmlWorkshop.CutTitle(plainDescr ?? string.Empty, 32))</a></div>
                                    </dd>
                                    <div class="cls"></div>
                                </dl>*@
                            }
                        }
                            <li class="cls"></li>
                        </ul>
                    </div>
                </div>
            </td>
            @*<td style="width:250px">
                <div class="newprod_panel">
                    <div class="newprod_bar">
                        <span class="lpan">产品中心2</span>
                        <span class="rpan">
                            <a href="#"><img src="/Images/num1a.jpg" alt="" /></a>
                            <a href="#"><img src="/Images/num2.jpg" alt="" /></a>
                            <a href="#"><img src="/Images/num3.jpg" alt="" /></a>
                        </span>
                    </div>
                    <div class="cls"></div>
                    <div class="newprod_info">
                        @{
                            List<PP_RecommendProduct> rprodList2 = ViewBag.RecomProductList2 as List<PP_RecommendProduct>;
                            foreach (var rprod in rprodList2)
                            {
                                string htmlDescr = Server.HtmlDecode(rprod.PP_Product != null ? rprod.PP_Product.Description : string.Empty);
                                string plainDescr = HtmlWorkshop.StripHtml(htmlDescr ?? string.Empty);
                                <dl>
                                    <dt><a href="/products/details/@rprod.ProductID" target="_blank"><img src="@rprod.IndexCover" alt="" /></a></dt>
                                    <dd>
                                        <h3><a href="/products/details/@rprod.ProductID" target="_blank">@(rprod.PP_Product != null ? rprod.PP_Product.ProductName : string.Empty)</a></h3>
                                        <div><a href="/products/details/@rprod.ProductID" target="_blank">@Html.Raw(HtmlWorkshop.CutTitle(plainDescr ?? string.Empty, 32))</a></div>
                                    </dd>
                                    <div class="cls"></div>
                                </dl>
                            }
                        }
                        <div class="cls"></div>
                    </div>
                </div>
            </td>*@
            <td style="width:200px">
                <div class="office_panel">
                    <div><img src="/Images/oa.jpg" alt="OA协同办公" /></div>
                    <div><img src="/Images/biz.jpg" alt="商务合作" /></div>
                </div>
            </td>
        </tr>
    </table>
</div>


